/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import dao.implementations.InstanceDaoMsSql;
import dao.interfaces.InstanceDao;
import engine.Instance;
import engine.Time;
import java.util.ArrayList;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 *
 * @author Johnny
 */
public class InstanceTester {

    public InstanceTester() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }

    @Test
    public void hello() {
        InstanceDao idao = new InstanceDaoMsSql();
        ArrayList<Instance> instList = idao.getInstances(1);
        for (Instance inst : instList) {
            System.out.println(inst);
        }
        System.out.println();

        //idao.addInstance(1);
        //idao.removeInstance(3);

        ArrayList<Time> times = instList.get(0).getSchedules();
        times.get(1).setTime(0, 20, 5);
        times.get(2).setTime(1, 1, 1);

        idao.setSchedule(instList.get(0));

        instList = idao.getInstances(1);
        for (Instance inst : instList) {
            System.out.println(inst);
        }
    }
}
